import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:flutter/material.dart';

class TransactionRecordTitleItem extends StatelessWidget {
  final String title;
  final double topPadding;
  final Widget trailing;
  final double bottomPadding;
  final double leftPadding;
  final bool hasBottomBorder;

  const TransactionRecordTitleItem(
      {Key key,
      this.title,
      this.hasBottomBorder,
      this.topPadding,
      this.leftPadding,
      this.trailing,
      this.bottomPadding})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
          left: leftPadding ?? getDp(18), bottom: bottomPadding ?? getDp(14)),
      decoration: BoxDecoration(
          border: Border(
              bottom: BorderSide(color: aceGrayColor, width: getDp(0.5)))),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Padding(
            padding: EdgeInsets.only(top: topPadding ?? getDp(21)),
            child: Text(
              title ?? '',
              style: TextStyle(
                color: aceDarkGrayColor,
                fontSize: getSp(16),
                fontWeight: FontWeight.w400,
                height: 14 / 16,
              ),
            ),
          ),
          if (trailing != null) trailing
        ],
      ),
    );
  }
}
